package com.dayangxiaoen.pms.enums;

import lombok.Getter;

/**
 * @author dayangxiaoen
 *
 * 1	SUCCESS	200	用户登录成功
 * 2	SERVER_ERROR	500	服务器出错
 * 3	USER_NOTFOUND	-999	用户名或密码错误
 * 4	PRODUCT_NOTFOUND	-10000	商品查询信息失败
 * 5	ADD_ERROR	-10001	添加商品出错
 * 6	UPDATE_ERROR	-10002	修改商品出错
 * 7	PRODUCT_NOTVERIFT	-10004	商品没有通过验证
 * 8	PRODUCT_NOTONLINE	-10005	商品未上线
 * 9	PRODUCT_NOTOFFLINE	-10006	商品未下线
 */
@Getter
public enum StatusCode{

    SUCCESS(200, "成功"),
    SERVER_ERROR(500, "服务器出错"),

    USER_NOT_REGISTER(-995, "用户没有注册"),

    LOGIN_LIMIT_ERROR(-996,"用户登录限制"),

    NO_LOGIN(-997,"用户未登录"),

    USERNAME_OR_PASSWORD_NULL(-998,"账户名或密码为空"),

    USER_NOTFOUND(-999,"用户名或密码错误"),
    PRODUCT_NOTFOUND(-10000,"商品查询信息失败"),




    ADD_ERROR(-10001,"添加商品失败"),
    UPDATE_ERROR(-10002,"修改商品出错"),


    PRODUCT_NOTVERIFT(-10004,"商品没有通过验证"),
    PRODUCT_NOTONLINE(-10005,"商品未上线"),
    PRODUCT_NOTOFFLINE(-10006,"商品未下线"),
    PRODUCT_TIMEOUT(-10007,"商品已经超时"),
    PRODUCT_ONLINEFAIL(-10008,"商品上线失败"),
    PRODUCT_OFFLINEFAIL(-10009,"商品下线失败"),
    PRODUCT_ALREADY_VERIFY(-10010,"商品已经发起过审核" );
    private final int value;
    private final String desc;

    StatusCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public boolean equalsValue(Integer value){
        if (value == null) {
            return false;
        }
        return getValue() == value;
    }
}
